//
//  CAnAlgSleep.h
//  
//  Created by  on 2024/9/4.
//  Sleep history data output by the device(设备输出的睡眠历史数据)

#import <Foundation/Foundation.h>
#import "CANalgProtocal.h"

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, NALG_SLEEP_STATE) {
    NALG_SLEEP_STATE_ASLEEP = 0x00, // 苏醒->睡眠
    NALG_SLEEP_STATE_WAKE = 0x01, //  睡眠->苏醒
};


@interface CAnAlgSleep : NSObject<CANalgProtocal>

@property(assign, nonatomic, readonly)uint8_t cmdByte;

@property(assign, nonatomic, readonly)NSUInteger timeStamp;// 本条报文的记录时间戳

@property(strong, nonatomic, readonly)NSNumber *dataUuid;

@property(assign, nonatomic, readonly)NSUInteger sleepDataTimeStamp; // 睡眠的时间戳
@property(assign, nonatomic, readonly)NALG_SLEEP_STATE state;

// unit: minute
@property(assign, nonatomic, readonly)uint16_t onBedDuration; //卧床时间 分钟

@property(assign, nonatomic, readonly)uint8_t wakeIndex; // 苏醒次序

- (instancetype)initWithData:(NSData *)data;

-(NSNumber *)dataTimeStamp;

@end

NS_ASSUME_NONNULL_END
